package com.coocaa.ops.admin.v1.todotask.convert;

import com.coocaa.ops.admin.v1.todotask.model.AuditTaskInfoModel;
import com.coocaa.ops.common.tool.base.InstanceUtil;
import lombok.experimental.UtilityClass;

import java.util.Map;

/**
 * @author bijiahao
 * @description
 * @date 2020/6/22 18:38
 */
@UtilityClass
public class DraftQueryConverter {


    public static Map<String, Object> getQueryParams(AuditTaskInfoModel model, Integer userId) {
        Map<String, Object> map = InstanceUtil.newHashMap();
        map.put("userId", userId);
        //分页查询参数
        int offset = (model.getPage() - 1) * model.getRows();
        map.put("offset", offset);
        map.put("limit", model.getRows());
        map.put("queryIsDraft", 1);
        return map;
    }
}
